package com.itheima.dianming.util;

import java.util.Calendar;
import java.util.Date;

public class DateUtils {

    public static Integer getYear(Date date){
        Calendar instance = Calendar.getInstance();
        instance.setTime(date);
        int weekYear = instance.getWeekYear();
        return weekYear;
    }

    public static Date getDate(Integer year){
        Calendar instance = Calendar.getInstance();
        instance.set(year,1,1);
        Date time = instance.getTime();
        return time;
    }

    public static void main(String[] args) {
        System.out.println(getYear(new Date()));
    }
}
